package homework6;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class MainEntrance extends Application{
	public void start(Stage primaryStage) {
		try {
			VBox vBox=new VBox();
			HBox hBox = new HBox();
	        GridPane gridPane = new GridPane();
	        Image image = new Image("image/1.png");
	        ImageView view = new ImageView(image);
	        
	        TextArea textArea = new TextArea();
	        TextField textField1 = new TextField();
	        TextField textField2 = new TextField();
	        gridPane.setHgap(20);
	        gridPane.setVgap(10);
	        gridPane.add(new Label(" 姓名：邱耀华 "),0,0);
	        gridPane.add(new Label(" 学号：201627010120"),1,0);
	        gridPane.add(new Label(" 学生："),0,1);
	        gridPane.add(textField1,1,1);
	        gridPane.add(new Label(" 老师："),0,2);
	        gridPane.add(textField2,1,2);
		
	        Button bt1 = new Button("添加学生");
	        Button bt2 = new Button("添加老师");
	        Button bt3 = new Button("删除学生");
	        Button bt4 = new Button("删除老师");
	        Button bt5 = new Button("学生选择老师");
	        Button bt6 = new Button("老师选择学生");
	        gridPane.add(bt1,0,3);
	        gridPane.add(bt2,1,3);
	        gridPane.add(bt3,0,4);
	        gridPane.add(bt4,1,4);
	        gridPane.add(bt5,0,5);
	        gridPane.add(bt6,1,5);
	        
	        hBox.getChildren().addAll(view,gridPane);
	        vBox.getChildren().addAll(hBox,textArea);
	        
	        Scene scene = new Scene(vBox);
	        primaryStage.setTitle("实例分析与数据库的设计");
	        primaryStage.setScene(scene);
	        primaryStage.show();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		launch(args);
	}
	
}